import {configureStore} from '@reduxjs/toolkit'
import UserInfo_Reducer from './UserInfoReducer'
import { UserInfoType } from './UserInfoReducer'
import undoable ,{StateWithHistory,excludeAction} from 'redux-undo'

import Component_Reducer,{ComponentSlice_StateType} from './ComponentReducer'


import Question_Reducer,{ QuestionSlice_StateType }  from './QuestionReducer'
export type StateType = {
    UserInfo_Reducer:UserInfoType,
    Component_Reducer:StateWithHistory<ComponentSlice_StateType>
    Question_Reducer:QuestionSlice_StateType
}

const store = configureStore({
    reducer:{
        UserInfo_Reducer,
        Component_Reducer:undoable(Component_Reducer,{
            limit:20,
            filter:excludeAction(['Component_Reducer/pasteComponent','Component_Reducer/copyOneComponent','Component_Reducer/selectNextComponent','Component_Reducer/resetComponents','Component_Reducer/selectPreComponent'])
        }),
        Question_Reducer
    }
})

export default store